<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue</title>
    <script src="./vue.js"></script>
    <style>
        #root {
            width: 500px;
            margin: 200px auto;
            text-align: center;
        }
    </style>
</head>

<body>
    <div id="root">
        <!-- 遍历数组 -->
        <ul>
            <li v-for='(gua,index) in guas' :key='gua.id'>{{gua.name}}---{{gua.price}}----{{index}}</li>
        </ul>
        <!-- 遍历对象 -->
        <ul>
            <li v-for='(value,key) in object'>{{value}}---{{key}}</li>
        </ul>
        <!-- 遍历字符串 -->
        <ul>
            <li v-for='(chr,index) in char'>{{chr}}---{{index}}</li>
        </ul>
        <!-- 遍历指定次数 -->
        <ul>
            <li v-for='(num,index) in 5'>{{num}}---{{index}}</li>
        </ul>
    </div>
    <script>
        Vue.config.productionTip = false
        const vm = new Vue({
            el: '#root',
            data: {
                guas: [{
                    name: '金瓜粒子',
                    price: '两块钱一斤',
                    id: '001'
                }, {
                    name: '金瓜皮',
                    price: '10块钱一斤',
                    id: '002'
                }],
                object: {
                    name: 'pink',
                    age: '18',
                },
                char: 'qwertyuiop'
            }
        })
    </script>
</body>

</html>